<style type="text/css">
    .overlay{
        position:absolute;top:0;left:0;width: 100%;background-color: #000;opacity: 0.2;z-index: 100
    }
    .hide{
        display: none;
    }
    .show{
        display: block;
    }
</style>
<div id="overlay" class="overlay hide"></div>
<div class="wrap">
    <div class="header">
        <?php echo $this->partial('header'); ?>    
        <div class="header_slide">
            <div class="header_bottom_left">				
                <?php echo $this->partial('product-ajax/category'); ?>				
            </div>
            <div class="header_bottom_right">					 
                <?php echo $this->partial('slider'); ?>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="main">
        <div class="content">
            <?php if (isset($aryNewProduct[0])) { ?>
                <div class="content_top">
                    <div class="heading">
                        <h3>Sản phẩm mới</h3>
                    </div>
                    <div class="see">
                        <p>
                            <a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-by-type', array('type' => 1, 'type_name' => 'san-pham-moi.html')); ?>')">Xem tất cả</a>
                        </p>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="section group">
                    <?php foreach ($aryNewProduct as $key => $newProduct) { ?>
                        <div class="grid_1_of_4 images_1_of_4 <?php echo ($key == 0) ? 'no-margin' : '' ?>">
                            <a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-detail', array('product_id' => $newProduct['product_id'], 'product_name' => $newProduct['product_name_filter'] . '.html')); ?>')">
                                <img alt="<?php echo $newProduct['product_name']; ?>" src="/upload/images/thumb/<?php echo $newProduct['product_image']; ?>">
                            </a>
                            <h2>
                                <a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-detail', array('product_id' => $newProduct['product_id'], 'product_name' => $newProduct['product_name_filter'] . '.html')); ?>')">
                                    <?php echo $newProduct['product_name']; ?>
                                </a>
                            </h2>
                            <div class="price-details">
                                <?php if ($newProduct['product_price_sale_of']) { ?>
                                    <div class="price-number">
                                        <p><span class="rupees"><?php echo number_format($newProduct['product_price'], 0, ',', '.') ?>₫</span></p>
                                    </div>
                                    <div class="add-cart">								
                                        <h4><a><?php echo number_format($newProduct['product_price_sale_of'], 0, ',', '.') ?>₫</a></h4>
                                    </div>
                                <?php } else { ?>
                                    <div class="add-cart">								
                                        <h4><a><?php echo number_format($newProduct['product_price'], 0, ',', '.') ?>₫</a></h4>
                                    </div>
                                <?php } ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    <?php } ?>
                </div>
            <?php } ?>
            <?php if (isset($arySaleOfProduct[0])) { ?>
                <div class="content_bottom">
                    <div class="heading">
                        <h3>Sản phẩm khuyến mại</h3>
                    </div>
                    <div class="see">
                        <p>
                            <a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-by-type', array('type' => 2, 'type_name' => 'san-pham-khuyen-mai.html')); ?>')">
                                Xem tất cả
                            </a>
                        </p>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="section group">
                    <?php foreach ($arySaleOfProduct as $key => $saleProduct) { ?>
                        <div class="grid_1_of_4 images_1_of_4 <?php echo ($key == 0) ? 'no-margin' : '' ?>">
                            <a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-detail', array('product_id' => $saleProduct['product_id'], 'product_name' => $saleProduct['product_name_filter'] . '.html')); ?>')">
                                <img alt="<?php echo $saleProduct['product_name']; ?>" src="/upload/images/thumb/<?php echo $saleProduct['product_image']; ?>">
                            </a>
                            <h2>
                                <a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-detail', array('product_id' => $saleProduct['product_id'], 'product_name' => $saleProduct['product_name_filter'] . '.html')); ?>')">
                                    <?php echo $saleProduct['product_name']; ?>
                                </a>
                            </h2>
                            <div class="price-details">
                                <?php if ($saleProduct['product_price_sale_of']) { ?>
                                    <div class="price-number">
                                        <p><span class="rupees"><?php echo number_format($saleProduct['product_price'], 0, ',', '.') ?>₫</span></p>
                                    </div>
                                    <div class="add-cart">								
                                        <h4><a><?php echo number_format($saleProduct['product_price_sale_of'], 0, ',', '.') ?>₫</a></h4>
                                    </div>
                                <?php } else { ?>
                                    <div class="add-cart">								
                                        <h4><a><?php echo number_format($saleProduct['product_price'], 0, ',', '.') ?>₫</a></h4>
                                    </div>
                                <?php } ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    <?php } ?>
                </div>
            <?php } ?>
            <?php if (isset($aryTopProduct[0])) { ?>
                <div class="content_bottom">
                    <div class="heading">
                        <h3>Sản phẩm bán chạy</h3>
                    </div>
                    <div class="see">
                        <p><a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-by-type', array('type' => 3, 'type_name' => 'san-pham-ban-chay.html')); ?>')">Xem tất cả</a></p>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="section group">
                    <?php foreach ($aryTopProduct as $key => $topProduct) { ?>
                        <div class="grid_1_of_4 images_1_of_4 <?php echo ($key == 0) ? 'no-margin' : '' ?>">
                            <a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-detail', array('product_id' => $topProduct['product_id'], 'product_name' => $topProduct['product_name_filter'] . '.html')); ?>')">
                                <img alt="<?php echo $topProduct['product_name']; ?>" src="/upload/images/thumb/<?php echo $topProduct['product_image']; ?>">
                            </a>
                            <h2>
                                <a style="cursor: pointer" onclick="productController.getListProduct('<?php echo $this->url('product-ajax/product-detail', array('product_id' => $topProduct['product_id'], 'product_name' => $topProduct['product_name_filter'] . '.html')); ?>')">
                                    <?php echo $topProduct['product_name']; ?>
                                </a>
                            </h2>
                            <div class="price-details">
                                <?php if ($topProduct['product_price_sale_of']) { ?>
                                    <div class="price-number">
                                        <p><span class="rupees"><?php echo number_format($topProduct['product_price'], 0, ',', '.') ?>₫</span></p>
                                    </div>
                                    <div class="add-cart">								
                                        <h4><a><?php echo number_format($topProduct['product_price_sale_of'], 0, ',', '.') ?>₫</a></h4>
                                    </div>
                                <?php } else { ?>
                                    <div class="add-cart">								
                                        <h4><a><?php echo number_format($topProduct['product_price'], 0, ',', '.') ?>₫</a></h4>
                                    </div>
                                <?php } ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    <?php } ?>
                </div>
            <?php } ?>
        </div>
    </div>
</div>
